import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-07-17
 * Time: 22:21
 */
public class Test62 {
    static List<List<String>> ret;
    static List<String> path;
    static char[] s1;
    public static List<List<String>> partition(String s) {
        ret = new ArrayList<>();
        path = new ArrayList<>();
        s1 = s.toCharArray();
        dfs(s1,0);
        return ret;
    }

    public static void dfs(char[] s1,int st) {
        if(st == s1.length) {
            ret.add(new ArrayList<>(path));
            return;
        }
        for(int i = st; i < s1.length; i++) {
            if(check(s1,st,i)) {
                path.add(new String(s1,st,i-st+1));
                dfs(s1,i+1);
                path.remove(path.size()-1);
            }
        }
    }

    public static boolean check(char[] s,int start,int end) {
        while(start <= end) {
            if(s[start++] != s[end--]) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        List<List<String>> ret = partition(s);
        System.out.println(ret);
    }
}
